home *** CD-ROM | disk | FTP | other *** search
/ MacWorld Secrets (4th Edition) / Mac Secrets CD 4th Ed.toast / Apple Advanced Technologies / Apple Speech Technologies 1.5 / PlainTalk Developer Info / Speech Recognition Manager SDK / SR 1.5 Interfaces & Lib / SpeechRecognition.a < prev    next >
Text File  |  1996-10-29  |  24KB  |  759 lines

  1. ;
  2. ;    File:        SpeechRecognition.a
  3. ;
  4. ;    Contains:    Apple Speech Recognition Toolbox Interfaces.
  5. ;
  6. ;    Version:    Technology:    PlainTalk 1.5
  7. ;
  8. ;                Release:    PlainTalk Developer Release
  9. ;
  10. ;    Copyright:    © 1984-1996 by Apple Computer, Inc.
  11. ;
  12. ;                All rights reserved.
  13. ;
  14. ;    Bugs?:        If you find a problem with this file, send the file and version
  15. ;                information (from above) and the problem description to:
  16. ;
  17. ;                    Internet:    apple.bugs@applelink.apple.com
  18. ;                    AppleLink:    APPLE.BUGS
  19. ;
  20. ;
  21.     IF &TYPE('__SPEECHRECOGNITION__') = 'UNDEFINED' THEN
  22. __SPEECHRECOGNITION__ SET 1
  23.  
  24.     IF &TYPE('__MEMORY__') = 'UNDEFINED' THEN
  25.     include 'Memory.a'
  26.     ENDIF
  27.  
  28. gestaltSpeechRecognitionVersion    EQU        'srtb'
  29. gestaltSpeechRecognitionAttr    EQU        'srta'
  30.  
  31. gestaltDesktopSpeechRecognition    EQU        $00000001
  32. gestaltTelephoneSpeechRecognition EQU    $00000002
  33. ;  Error Codes [Speech recognition gets -5100 through -5199] 
  34.  
  35. kSRNotAvailable                    EQU        -5100                ; the service requested is not avail or applicable 
  36. kSRInternalError                EQU        -5101                ; a system internal or hardware error condition 
  37. kSRComponentNotFound            EQU        -5102                ; a needed system resource was not located 
  38. kSROutOfMemory                    EQU        -5103                ; an out of memory error occurred in the toolbox memory space 
  39. kSRNotASpeechObject                EQU        -5104                ; the object specified is no longer or never was valid 
  40. kSRBadParameter                    EQU        -5105                ; an invalid parameter was specified 
  41. kSRParamOutOfRange                EQU        -5106                ; when we say 0-100, don't pass in 101. 
  42. kSRBadSelector                    EQU        -5107                ; an unrecognized selector was specified 
  43. kSRBufferTooSmall                EQU        -5108                ; returned from attribute access functions 
  44. kSRNotARecSystem                EQU        -5109                ; the object used was not a SRRecognitionSystem 
  45. kSRFeedbackNotAvail                EQU        -5110                ; there is no feedback window associated with SRRecognizer 
  46. kSRCantSetProperty                EQU        -5111                ; a non-settable property was specified 
  47. kSRCantGetProperty                EQU        -5112                ; a non-gettable property was specified 
  48. kSRCantSetDuringRecognition        EQU        -5113                ; the property can't be set while recognition is in progress -- do before or between utterances. 
  49. kSRAlreadyListening                EQU        -5114                ; in response to SRStartListening 
  50. kSRNotListeningState            EQU        -5115                ; in response to SRStopListening 
  51. kSRModelMismatch                EQU        -5116                ; no acoustical models are avail to match request 
  52. kSRNoClientLanguageModel        EQU        -5117                ; trying to access a non-specified SRLanguageModel 
  53. kSRNoPendingUtterances            EQU        -5118                ; nothing to continue search on 
  54. kSRRecognitionCanceled            EQU        -5119                ; an abort error occurred during search 
  55. kSRRecognitionDone                EQU        -5120                ; search has finished, but nothing was recognized 
  56. kSROtherRecAlreadyModal            EQU        -5121                ; another recognizer is modal at the moment, so can't set this recognizer's kSRBlockModally property right now 
  57. kSRHasNoSubItems                EQU        -5122                ; SRCountItems or related routine was called on an object without subelements -- e.g. a word -- rather than phrase, path, or LM. 
  58. kSRSubItemNotFound                EQU        -5123                ; returned when accessing a non-existent sub item of a container 
  59. kSRLanguageModelTooBig            EQU        -5124                ; Cant build language models so big 
  60. kSRAlreadyReleased                EQU        -5125                ; this object has already been released before 
  61. kSRAlreadyFinished                EQU        -5126                ; the language model can't be finished twice 
  62. kSRWordNotFound                    EQU        -5127                ; the spelling couldn't be found in lookup(s) 
  63. kSRNotFinishedWithRejection        EQU        -5128                ; property not found because the LMObj is not finished with rejection 
  64. kSRExpansionTooDeep                EQU        -5129                ; Language model is left recursive or is embedded too many levels 
  65. kSRTooManyElements                EQU        -5130                ; Too many elements added to phrase or path or other langauge model object 
  66. kSRCantAdd                        EQU        -5131                ; Can't add given type of object to the base SRLanguageObject (e.g.in SRAddLanguageObject)    
  67. kSRSndInSourceDisconnected        EQU        -5132                ; Sound input source is disconnected 
  68. kSRCantReadLanguageObject        EQU        -5133                ; An error while trying to create new Language object from file or pointer -- possibly bad format 
  69.                                                             ; non-release debugging error codes are included here 
  70. kSRNotImplementedYet            EQU        -5199                ; you'd better wait for this feature in a future release 
  71. ;  Type Definitions 
  72.  
  73.  
  74. ; typedef SRSpeechObject                 SRRecognitionSystem
  75.  
  76. ; typedef SRSpeechObject                 SRRecognizer
  77.  
  78. ; typedef SRSpeechObject                 SRSpeechSource
  79.  
  80. ; typedef SRSpeechSource                 SRRecognitionResult
  81.  
  82. ; typedef SRSpeechObject                 SRLanguageObject
  83.  
  84. ; typedef SRLanguageObject                 SRLanguageModel
  85.  
  86. ; typedef SRLanguageObject                 SRPath
  87.  
  88. ; typedef SRLanguageObject                 SRPhrase
  89.  
  90. ; typedef SRLanguageObject                 SRWord
  91.  
  92. ;  between 0 and 100 
  93. ; typedef unsigned short                 SRSpeedSetting
  94.  
  95. ;  between 0 and 100 
  96. ; typedef unsigned short                 SRRejectionLevel
  97.  
  98. ;  When an event occurs, the user supplied proc will be called with a pointer    
  99. ;     to the param passed in and a flag to indicate conditions such                
  100. ;     as interrupt time or system background time.                                
  101. SRCallBackStruct        RECORD 0
  102. what                     ds.l    1                ; offset: $0 (0)        ;  one of notification flags 
  103. message                     ds.l    1                ; offset: $4 (4)        ;  contains SRRecognitionResult id 
  104. instance                 ds.l    1                ; offset: $8 (8)        ;  ID of recognizer being notified 
  105. status                     ds.w    1                ; offset: $C (12)        ;  result status of last search 
  106. flags                     ds.w    1                ; offset: $E (14)        ;  non-zero if occurs during interrupt 
  107. refCon                     ds.l    1                ; offset: $10 (16)        ;  user defined - set from SRCallBackParam 
  108. sizeof                     EQU *                    ; size:   $14 (20)
  109.                         ENDR
  110. ;  Call back procedure definition 
  111. SRCallBackParam            RECORD 0
  112. callBack                 ds.l    1                ; offset: $0 (0)
  113. refCon                     ds.l    1                ; offset: $4 (4)
  114. sizeof                     EQU *                    ; size:   $8 (8)
  115.                         ENDR
  116. ;  Recognition System Types 
  117.  
  118. kSRDefaultRecognitionSystemID    EQU        0
  119. ;  Recognition System Properties 
  120.  
  121. kSRFeedbackAndListeningModes    EQU        'fbwn'                ; short: one of kSRNoFeedbackHasListenModes, kSRHasFeedbackHasListenModes, kSRNoFeedbackNoListenModes 
  122. kSRRejectedWord                    EQU        'rejq'                ; the SRWord used to represent a rejection 
  123. kSRCleanupOnClientExit            EQU        'clup'                ; Boolean: Default is true. The rec system and everything it owns is disposed when the client application quits 
  124.  
  125. kSRNoFeedbackNoListenModes        EQU        0                    ; next allocated recognizer has no feedback window and doesn't use listening modes    
  126. kSRHasFeedbackHasListenModes    EQU        1                    ; next allocated recognizer has feedback window and uses listening modes             
  127. kSRNoFeedbackHasListenModes        EQU        2                    ; next allocated recognizer has no feedback window but does use listening modes     
  128. ;  Speech Source Types 
  129.  
  130. kSRDefaultSpeechSource            EQU        0
  131. kSRLiveDesktopSpeechSource        EQU        'dklv'                ; live desktop sound input 
  132. kSRCanned22kHzSpeechSource        EQU        'ca22'                ; AIFF file based 16 bit, 22.050 KHz sound input 
  133. ;  Notification via Apple Event or Callback 
  134. ;  Notification Flags 
  135.  
  136. kSRNotifyRecognitionBeginning    EQU        $00000001            ; recognition can begin. client must now call SRContinueRecognition or SRCancelRecognition 
  137. kSRNotifyRecognitionDone        EQU        $00000002            ; recognition has terminated. result (if any) is available. 
  138. ;  Apple Event selectors 
  139. ;  AppleEvent message class  
  140.  
  141. kAESpeechSuite                    EQU        'sprc'
  142. ;  AppleEvent message event ids 
  143.  
  144. kAESpeechDone                    EQU        'srsd'
  145. kAESpeechDetected                EQU        'srbd'
  146. ;  AppleEvent Parameter ids 
  147.  
  148. keySRRecognizer                    EQU        'krec'
  149. keySRSpeechResult                EQU        'kspr'
  150. keySRSpeechStatus                EQU        'ksst'
  151. ;  AppleEvent Parameter types 
  152.  
  153. typeSRRecognizer                EQU        'trec'
  154. typeSRSpeechResult                EQU        'tspr'
  155. ;  SRRecognizer Properties 
  156.  
  157. kSRNotificationParam            EQU        'noti'                ; see notification flags below 
  158. kSRCallBackParam                EQU        'call'                ; type SRCallBackParam 
  159. kSRSearchStatusParam            EQU        'stat'                ; see status flags below 
  160. kSRAutoFinishingParam            EQU        'afin'                ; automatic finishing applied on LM for search 
  161. kSRForegroundOnly                EQU        'fgon'                ; Boolean. Default is true. If true, client recognizer only active when in foreground.    
  162. kSRBlockBackground                EQU        'blbg'                ; Boolean. Default is false. If true, when client recognizer in foreground, rest of LMs are inactive.    
  163. kSRBlockModally                    EQU        'blmd'                ; Boolean. Default is false. When true, this client's LM is only active LM; all other LMs are inactive. Be nice, don't be modal for long periods! 
  164. kSRWantsResultTextDrawn            EQU        'txfb'                ; Boolean. Default is true. If true, search results are posted to Feedback window 
  165. kSRWantsAutoFBGestures            EQU        'dfbr'                ; Boolean. Default is true. If true, client needn't call SRProcessBegin/End to get default feedback behavior 
  166. kSRSoundInVolume                EQU        'volu'                ; short in [0..100] log scaled sound input power. Can't set this property 
  167. kSRReadAudioFSSpec                EQU        'aurd'                ; *FSSpec. Specify FSSpec where raw audio is to be read (AIFF format) using kSRCanned22kHzSpeechSource. Reads until EOF 
  168. kSRCancelOnSoundOut                EQU        'caso'                ; Boolean: Default is true.  If any sound is played out during utterance, recognition is aborted. 
  169. kSRSpeedVsAccuracyParam            EQU        'sped'                ; SRSpeedSetting between 0 and 100 
  170. ;  0 means more accurate but slower. 
  171. ;  100 means (much) less accurate but faster. 
  172.  
  173. kSRUseToggleListen                EQU        0                    ; listen key modes 
  174. kSRUsePushToTalk                EQU        1
  175.  
  176. kSRListenKeyMode                EQU        'lkmd'                ; short: either kSRUseToggleListen or kSRUsePushToTalk 
  177. kSRListenKeyCombo                EQU        'lkey'                ; short: Push-To-Talk key combination; high byte is high byte of event->modifiers, the low byte is the keycode from event->message 
  178. kSRListenKeyName                EQU        'lnam'                ; Str63: string representing ListenKeyCombo 
  179. kSRKeyWord                        EQU        'kwrd'                ; Str255: keyword preceding spoken commands in kSRUseToggleListen mode 
  180. kSRKeyExpected                    EQU        'kexp'                ; Boolean: Must the PTT key be depressed or the key word spoken before recognition can occur? 
  181. ;  Operational Status Flags 
  182.  
  183. kSRIdleRecognizer                EQU        $00000001            ; engine is not active 
  184. kSRSearchInProgress                EQU        $00000002            ; search is in progress 
  185. kSRSearchWaitForAllClients        EQU        $00000004            ; search is suspended waiting on all clients' input 
  186. kSRMustCancelSearch                EQU        $00000008            ; something has occurred (sound played, non-speech detected) requiring the search to abort 
  187. kSRPendingSearch                EQU        $00000010            ; we're about to start searching 
  188. ;  Recognition Result Properties 
  189.  
  190. kSRTEXTFormat                    EQU        'TEXT'                ; raw text in user supplied memory 
  191. kSRPhraseFormat                    EQU        'lmph'                ; SRPhrase containing result words 
  192. kSRPathFormat                    EQU        'lmpt'                ; SRPath containing result phrases or words 
  193. kSRLanguageModelFormat            EQU        'lmfm'                ; top level SRLanguageModel for post parse 
  194. ;  SRLanguageObject Family Properties 
  195.  
  196. kSRSpelling                        EQU        'spel'                ; spelling of a SRWord or SRPhrase or SRPath, or name of a SRLanguageModel 
  197. kSRLMObjType                    EQU        'lmtp'                ; Returns one of SRLanguageObject Types listed below 
  198. kSRRefCon                        EQU        'refc'                ; 4 bytes of user storage 
  199. kSROptional                        EQU        'optl'                ; Boolean -- true if SRLanguageObject is optional    
  200. kSREnabled                        EQU        'enbl'                ; Boolean -- true if SRLanguageObject enabled 
  201. kSRRepeatable                    EQU        'rptb'                ; Boolean -- true if SRLanguageObject is repeatable 
  202. kSRRejectable                    EQU        'rjbl'                ; Boolean -- true if SRLanguageObject is rejectable (Recognition System's kSRRejectedWord 
  203.                                                             ;        object can be returned in place of SRLanguageObject with this property)    
  204. kSRRejectionLevel                EQU        'rjct'                ; SRRejectionLevel between 0 and 100 
  205. ;  LM Object Types -- returned as kSRLMObjType property of language model objects 
  206.  
  207. kSRLanguageModelType            EQU        'lmob'                ; SRLanguageModel 
  208. kSRPathType                        EQU        'path'                ; SRPath 
  209. kSRPhraseType                    EQU        'phra'                ; SRPhrase 
  210. kSRWordType                        EQU        'word'                ; SRWord 
  211. ;  a normal and reasonable rejection level 
  212.  
  213. kSRDefaultRejectionLevel        EQU        50
  214. ; ******************************************************************************
  215. ;                         NOTES ON USING THE API                                    
  216. ;                                                                                 
  217. ;         All operations (with the exception of SRGetRecognitionSystem) are        
  218. ;         directed toward an object allocated or begot from New, Get and Read        
  219. ;         type calls.                                                                
  220. ;                                                                                 
  221. ;         There is a simple rule in dealing with allocation and disposal:            
  222. ;                                                                                 
  223. ;         *    all toolbox allocations are obtained from a SRRecognitionSystem        
  224. ;                                                                                 
  225. ;         *    if you obtain an object via New or Get, then you own a reference     
  226. ;             to that object and it must be released via SRReleaseObject when        
  227. ;             you no longer need it                                                
  228. ;                                                                                 
  229. ;         *    when you receive a SRRecognitionResult object via AppleEvent or        
  230. ;             callback, it has essentially been created on your behalf and so        
  231. ;             you are responsible for releasing it as above                        
  232. ;                                                                                 
  233. ;         *    when you close a SRRecognitionSystem, all remaining objects which        
  234. ;             were allocated with it will be forcefully released and any            
  235. ;             remaining references to those objects will be invalid.                
  236. ;                                                                                 
  237. ;         This translates into a very simple guideline:                            
  238. ;             If you allocate it or have it allocated for you, you must release    
  239. ;             it.  If you are only peeking at it, then don't release it.            
  240. ;                                                                                 
  241. ; ******************************************************************************
  242. ;  Opening and Closing of the SRRecognitionSystem 
  243. ;
  244. ; pascal OSErr SROpenRecognitionSystem(SRRecognitionSystem *system, OSType systemID)
  245. ;
  246.     IF ¬ GENERATINGCFM THEN
  247.         Macro
  248.         _SROpenRecognitionSystem
  249.             move.w              #$0400,d0
  250.             dc.w                $AA56
  251.         EndM
  252.     ELSE
  253.         IMPORT_CFM_FUNCTION SROpenRecognitionSystem
  254.     ENDIF
  255.  
  256. ;
  257. ; pascal OSErr SRCloseRecognitionSystem(SRRecognitionSystem system)
  258. ;
  259.     IF ¬ GENERATINGCFM THEN
  260.         Macro
  261.         _SRCloseRecognitionSystem
  262.             move.w              #$0201,d0
  263.             dc.w                $AA56
  264.         EndM
  265.     ELSE
  266.         IMPORT_CFM_FUNCTION SRCloseRecognitionSystem
  267.     ENDIF
  268.  
  269. ;  Accessing Properties of any Speech Object 
  270. ;
  271. ; pascal OSErr SRSetProperty(SRSpeechObject srObject, OSType selector, const void *property, Size propertyLen)
  272. ;
  273.     IF ¬ GENERATINGCFM THEN
  274.         Macro
  275.         _SRSetProperty
  276.             move.w              #$0802,d0
  277.             dc.w                $AA56
  278.         EndM
  279.     ELSE
  280.         IMPORT_CFM_FUNCTION SRSetProperty
  281.     ENDIF
  282.  
  283. ;
  284. ; pascal OSErr SRGetProperty(SRSpeechObject srObject, OSType selector, void *property, Size *propertyLen)
  285. ;
  286.     IF ¬ GENERATINGCFM THEN
  287.         Macro
  288.         _SRGetProperty
  289.             move.w              #$0803,d0
  290.             dc.w                $AA56
  291.         EndM
  292.     ELSE
  293.         IMPORT_CFM_FUNCTION SRGetProperty
  294.     ENDIF
  295.  
  296. ;  Any object obtained via New or Get type calls must be released 
  297. ;
  298. ; pascal OSErr SRReleaseObject(SRSpeechObject srObject)
  299. ;
  300.     IF ¬ GENERATINGCFM THEN
  301.         Macro
  302.         _SRReleaseObject
  303.             move.w              #$0204,d0
  304.             dc.w                $AA56
  305.         EndM
  306.     ELSE
  307.         IMPORT_CFM_FUNCTION SRReleaseObject
  308.     ENDIF
  309.  
  310. ;
  311. ; pascal OSErr SRGetReference(SRSpeechObject srObject, SRSpeechObject *newObjectRef)
  312. ;
  313.     IF ¬ GENERATINGCFM THEN
  314.         Macro
  315.         _SRGetReference
  316.             move.w              #$0425,d0
  317.             dc.w                $AA56
  318.         EndM
  319.     ELSE
  320.         IMPORT_CFM_FUNCTION SRGetReference
  321.     ENDIF
  322.  
  323. ;  SRRecognizer Instance Functions 
  324. ;
  325. ; pascal OSErr SRNewRecognizer(SRRecognitionSystem system, SRRecognizer *recognizer, OSType sourceID)
  326. ;
  327.     IF ¬ GENERATINGCFM THEN
  328.         Macro
  329.         _SRNewRecognizer
  330.             move.w              #$060A,d0
  331.             dc.w                $AA56
  332.         EndM
  333.     ELSE
  334.         IMPORT_CFM_FUNCTION SRNewRecognizer
  335.     ENDIF
  336.  
  337. ;
  338. ; pascal OSErr SRStartListening(SRRecognizer recognizer)
  339. ;
  340.     IF ¬ GENERATINGCFM THEN
  341.         Macro
  342.         _SRStartListening
  343.             move.w              #$020C,d0
  344.             dc.w                $AA56
  345.         EndM
  346.     ELSE
  347.         IMPORT_CFM_FUNCTION SRStartListening
  348.     ENDIF
  349.  
  350. ;
  351. ; pascal OSErr SRStopListening(SRRecognizer recognizer)
  352. ;
  353.     IF ¬ GENERATINGCFM THEN
  354.         Macro
  355.         _SRStopListening
  356.             move.w              #$020D,d0
  357.             dc.w                $AA56
  358.         EndM
  359.     ELSE
  360.         IMPORT_CFM_FUNCTION SRStopListening
  361.     ENDIF
  362.  
  363. ;
  364. ; pascal OSErr SRSetLanguageModel(SRRecognizer recognizer, SRLanguageModel languageModel)
  365. ;
  366.     IF ¬ GENERATINGCFM THEN
  367.         Macro
  368.         _SRSetLanguageModel
  369.             move.w              #$040E,d0
  370.             dc.w                $AA56
  371.         EndM
  372.     ELSE
  373.         IMPORT_CFM_FUNCTION SRSetLanguageModel
  374.     ENDIF
  375.  
  376. ;
  377. ; pascal OSErr SRGetLanguageModel(SRRecognizer recognizer, SRLanguageModel *languageModel)
  378. ;
  379.     IF ¬ GENERATINGCFM THEN
  380.         Macro
  381.         _SRGetLanguageModel
  382.             move.w              #$040F,d0
  383.             dc.w                $AA56
  384.         EndM
  385.     ELSE
  386.         IMPORT_CFM_FUNCTION SRGetLanguageModel
  387.     ENDIF
  388.  
  389. ;
  390. ; pascal OSErr SRContinueRecognition(SRRecognizer recognizer)
  391. ;
  392.     IF ¬ GENERATINGCFM THEN
  393.         Macro
  394.         _SRContinueRecognition
  395.             move.w              #$0210,d0
  396.             dc.w                $AA56
  397.         EndM
  398.     ELSE
  399.         IMPORT_CFM_FUNCTION SRContinueRecognition
  400.     ENDIF
  401.  
  402. ;
  403. ; pascal OSErr SRCancelRecognition(SRRecognizer recognizer)
  404. ;
  405.     IF ¬ GENERATINGCFM THEN
  406.         Macro
  407.         _SRCancelRecognition
  408.             move.w              #$0211,d0
  409.             dc.w                $AA56
  410.         EndM
  411.     ELSE
  412.         IMPORT_CFM_FUNCTION SRCancelRecognition
  413.     ENDIF
  414.  
  415. ;
  416. ; pascal OSErr SRIdle(void )
  417. ;
  418.     IF ¬ GENERATINGCFM THEN
  419.         Macro
  420.         _SRIdle
  421.             move.w              #$0028,d0
  422.             dc.w                $AA56
  423.         EndM
  424.     ELSE
  425.         IMPORT_CFM_FUNCTION SRIdle
  426.     ENDIF
  427.  
  428. ;  Language Model Building and Manipulation Functions 
  429. ;
  430. ; pascal OSErr SRNewLanguageModel(SRRecognitionSystem system, SRLanguageModel *model, const void *name, Size nameLength)
  431. ;
  432.     IF ¬ GENERATINGCFM THEN
  433.         Macro
  434.         _SRNewLanguageModel
  435.             move.w              #$0812,d0
  436.             dc.w                $AA56
  437.         EndM
  438.     ELSE
  439.         IMPORT_CFM_FUNCTION SRNewLanguageModel
  440.     ENDIF
  441.  
  442. ;
  443. ; pascal OSErr SRNewPath(SRRecognitionSystem system, SRPath *path)
  444. ;
  445.     IF ¬ GENERATINGCFM THEN
  446.         Macro
  447.         _SRNewPath
  448.             move.w              #$0413,d0
  449.             dc.w                $AA56
  450.         EndM
  451.     ELSE
  452.         IMPORT_CFM_FUNCTION SRNewPath
  453.     ENDIF
  454.  
  455. ;
  456. ; pascal OSErr SRNewPhrase(SRRecognitionSystem system, SRPhrase *phrase, const void *text, Size textLength)
  457. ;
  458.     IF ¬ GENERATINGCFM THEN
  459.         Macro
  460.         _SRNewPhrase
  461.             move.w              #$0814,d0
  462.             dc.w                $AA56
  463.         EndM
  464.     ELSE
  465.         IMPORT_CFM_FUNCTION SRNewPhrase
  466.     ENDIF
  467.  
  468. ;
  469. ; pascal OSErr SRNewWord(SRRecognitionSystem system, SRWord *word, const void *text, Size textLength)
  470. ;
  471.     IF ¬ GENERATINGCFM THEN
  472.         Macro
  473.         _SRNewWord
  474.             move.w              #$0815,d0
  475.             dc.w                $AA56
  476.         EndM
  477.     ELSE
  478.         IMPORT_CFM_FUNCTION SRNewWord
  479.     ENDIF
  480.  
  481. ;  Operations on any object of the SRLanguageObject family 
  482. ;
  483. ; pascal OSErr SRPutLanguageObjectIntoHandle(SRLanguageObject languageObject, Handle lobjHandle)
  484. ;
  485.     IF ¬ GENERATINGCFM THEN
  486.         Macro
  487.         _SRPutLanguageObjectIntoHandle
  488.             move.w              #$0416,d0
  489.             dc.w                $AA56
  490.         EndM
  491.     ELSE
  492.         IMPORT_CFM_FUNCTION SRPutLanguageObjectIntoHandle
  493.     ENDIF
  494.  
  495. ;
  496. ; pascal OSErr SRPutLanguageObjectIntoDataFile(SRLanguageObject languageObject, short fRefNum)
  497. ;
  498.     IF ¬ GENERATINGCFM THEN
  499.         Macro
  500.         _SRPutLanguageObjectIntoDataFile
  501.             move.w              #$0328,d0
  502.             dc.w                $AA56
  503.         EndM
  504.     ELSE
  505.         IMPORT_CFM_FUNCTION SRPutLanguageObjectIntoDataFile
  506.     ENDIF
  507.  
  508. ;
  509. ; pascal OSErr SRNewLanguageObjectFromHandle(SRRecognitionSystem system, SRLanguageObject *languageObject, Handle lObjHandle)
  510. ;
  511.     IF ¬ GENERATINGCFM THEN
  512.         Macro
  513.         _SRNewLanguageObjectFromHandle
  514.             move.w              #$0417,d0
  515.             dc.w                $AA56
  516.         EndM
  517.     ELSE
  518.         IMPORT_CFM_FUNCTION SRNewLanguageObjectFromHandle
  519.     ENDIF
  520.  
  521. ;
  522. ; pascal OSErr SRNewLanguageObjectFromDataFile(SRRecognitionSystem system, SRLanguageObject *languageObject, short fRefNum)
  523. ;
  524.     IF ¬ GENERATINGCFM THEN
  525.         Macro
  526.         _SRNewLanguageObjectFromDataFile
  527.             move.w              #$0427,d0
  528.             dc.w                $AA56
  529.         EndM
  530.     ELSE
  531.         IMPORT_CFM_FUNCTION SRNewLanguageObjectFromDataFile
  532.     ENDIF
  533.  
  534. ;
  535. ; pascal OSErr SREmptyLanguageObject(SRLanguageObject languageObject)
  536. ;
  537.     IF ¬ GENERATINGCFM THEN
  538.         Macro
  539.         _SREmptyLanguageObject
  540.             move.w              #$0218,d0
  541.             dc.w                $AA56
  542.         EndM
  543.     ELSE
  544.         IMPORT_CFM_FUNCTION SREmptyLanguageObject
  545.     ENDIF
  546.  
  547. ;
  548. ; pascal OSErr SRChangeLanguageObject(SRLanguageObject languageObject, const void *text, Size textLength)
  549. ;
  550.     IF ¬ GENERATINGCFM THEN
  551.         Macro
  552.         _SRChangeLanguageObject
  553.             move.w              #$0619,d0
  554.             dc.w                $AA56
  555.         EndM
  556.     ELSE
  557.         IMPORT_CFM_FUNCTION SRChangeLanguageObject
  558.     ENDIF
  559.  
  560. ;
  561. ; pascal OSErr SRAddLanguageObject(SRLanguageObject base, SRLanguageObject addon)
  562. ;
  563.     IF ¬ GENERATINGCFM THEN
  564.         Macro
  565.         _SRAddLanguageObject
  566.             move.w              #$041A,d0
  567.             dc.w                $AA56
  568.         EndM
  569.     ELSE
  570.         IMPORT_CFM_FUNCTION SRAddLanguageObject
  571.     ENDIF
  572.  
  573. ;
  574. ; pascal OSErr SRAddText(SRLanguageObject base, const void *text, Size textLength, long refCon)
  575. ;
  576.     IF ¬ GENERATINGCFM THEN
  577.         Macro
  578.         _SRAddText
  579.             move.w              #$081B,d0
  580.             dc.w                $AA56
  581.         EndM
  582.     ELSE
  583.         IMPORT_CFM_FUNCTION SRAddText
  584.     ENDIF
  585.  
  586. ;
  587. ; pascal OSErr SRRemoveLanguageObject(SRLanguageObject base, SRLanguageObject toRemove)
  588. ;
  589.     IF ¬ GENERATINGCFM THEN
  590.         Macro
  591.         _SRRemoveLanguageObject
  592.             move.w              #$041C,d0
  593.             dc.w                $AA56
  594.         EndM
  595.     ELSE
  596.         IMPORT_CFM_FUNCTION SRRemoveLanguageObject
  597.     ENDIF
  598.  
  599. ;  Traversing SRRecognitionResults or SRLanguageObjects 
  600. ;
  601. ; pascal OSErr SRCountItems(SRSpeechObject container, long *count)
  602. ;
  603.     IF ¬ GENERATINGCFM THEN
  604.         Macro
  605.         _SRCountItems
  606.             move.w              #$0405,d0
  607.             dc.w                $AA56
  608.         EndM
  609.     ELSE
  610.         IMPORT_CFM_FUNCTION SRCountItems
  611.     ENDIF
  612.  
  613. ;
  614. ; pascal OSErr SRGetIndexedItem(SRSpeechObject container, SRSpeechObject *item, long index)
  615. ;
  616.     IF ¬ GENERATINGCFM THEN
  617.         Macro
  618.         _SRGetIndexedItem
  619.             move.w              #$0606,d0
  620.             dc.w                $AA56
  621.         EndM
  622.     ELSE
  623.         IMPORT_CFM_FUNCTION SRGetIndexedItem
  624.     ENDIF
  625.  
  626. ;
  627. ; pascal OSErr SRSetIndexedItem(SRSpeechObject container, SRSpeechObject item, long index)
  628. ;
  629.     IF ¬ GENERATINGCFM THEN
  630.         Macro
  631.         _SRSetIndexedItem
  632.             move.w              #$0607,d0
  633.             dc.w                $AA56
  634.         EndM
  635.     ELSE
  636.         IMPORT_CFM_FUNCTION SRSetIndexedItem
  637.     ENDIF
  638.  
  639. ;
  640. ; pascal OSErr SRRemoveIndexedItem(SRSpeechObject container, long index)
  641. ;
  642.     IF ¬ GENERATINGCFM THEN
  643.         Macro
  644.         _SRRemoveIndexedItem
  645.             move.w              #$0408,d0
  646.             dc.w                $AA56
  647.         EndM
  648.     ELSE
  649.         IMPORT_CFM_FUNCTION SRRemoveIndexedItem
  650.     ENDIF
  651.  
  652. ;  Utilizing the System Feedback Window 
  653. ;
  654. ; pascal OSErr SRDrawText(SRRecognizer recognizer, const void *dispText, Size dispLength)
  655. ;
  656.     IF ¬ GENERATINGCFM THEN
  657.         Macro
  658.         _SRDrawText
  659.             move.w              #$0621,d0
  660.             dc.w                $AA56
  661.         EndM
  662.     ELSE
  663.         IMPORT_CFM_FUNCTION SRDrawText
  664.     ENDIF
  665.  
  666. ;
  667. ; pascal OSErr SRDrawRecognizedText(SRRecognizer recognizer, const void *dispText, Size dispLength)
  668. ;
  669.     IF ¬ GENERATINGCFM THEN
  670.         Macro
  671.         _SRDrawRecognizedText
  672.             move.w              #$0622,d0
  673.             dc.w                $AA56
  674.         EndM
  675.     ELSE
  676.         IMPORT_CFM_FUNCTION SRDrawRecognizedText
  677.     ENDIF
  678.  
  679. ;
  680. ; pascal OSErr SRSpeakText(SRRecognizer recognizer, const void *speakText, Size speakLength)
  681. ;
  682.     IF ¬ GENERATINGCFM THEN
  683.         Macro
  684.         _SRSpeakText
  685.             move.w              #$0620,d0
  686.             dc.w                $AA56
  687.         EndM
  688.     ELSE
  689.         IMPORT_CFM_FUNCTION SRSpeakText
  690.     ENDIF
  691.  
  692. ;
  693. ; pascal OSErr SRSpeakAndDrawText(SRRecognizer recognizer, const void *text, Size textLength)
  694. ;
  695.     IF ¬ GENERATINGCFM THEN
  696.         Macro
  697.         _SRSpeakAndDrawText
  698.             move.w              #$061F,d0
  699.             dc.w                $AA56
  700.         EndM
  701.     ELSE
  702.         IMPORT_CFM_FUNCTION SRSpeakAndDrawText
  703.     ENDIF
  704.  
  705. ;
  706. ; pascal OSErr SRStopSpeech(SRRecognizer recognizer)
  707. ;
  708.     IF ¬ GENERATINGCFM THEN
  709.         Macro
  710.         _SRStopSpeech
  711.             move.w              #$0223,d0
  712.             dc.w                $AA56
  713.         EndM
  714.     ELSE
  715.         IMPORT_CFM_FUNCTION SRStopSpeech
  716.     ENDIF
  717.  
  718. ;
  719. ; pascal Boolean SRSpeechBusy(SRRecognizer recognizer)
  720. ;
  721.     IF ¬ GENERATINGCFM THEN
  722.         Macro
  723.         _SRSpeechBusy
  724.             move.w              #$0224,d0
  725.             dc.w                $AA56
  726.         EndM
  727.     ELSE
  728.         IMPORT_CFM_FUNCTION SRSpeechBusy
  729.     ENDIF
  730.  
  731. ;
  732. ; pascal OSErr SRProcessBegin(SRRecognizer recognizer, Boolean failed)
  733. ;
  734.     IF ¬ GENERATINGCFM THEN
  735.         Macro
  736.         _SRProcessBegin
  737.             move.w              #$031D,d0
  738.             dc.w                $AA56
  739.         EndM
  740.     ELSE
  741.         IMPORT_CFM_FUNCTION SRProcessBegin
  742.     ENDIF
  743.  
  744. ;
  745. ; pascal OSErr SRProcessEnd(SRRecognizer recognizer, Boolean failed)
  746. ;
  747.     IF ¬ GENERATINGCFM THEN
  748.         Macro
  749.         _SRProcessEnd
  750.             move.w              #$031E,d0
  751.             dc.w                $AA56
  752.         EndM
  753.     ELSE
  754.         IMPORT_CFM_FUNCTION SRProcessEnd
  755.     ENDIF
  756.  
  757.     ENDIF ; __SPEECHRECOGNITION__ 
  758.  
  759.